<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title></title>
<import type="css" file="css.form" />
<import type="css" file="css.global" />
<import type="js" file="js.common" />
<import type="js" file="js.jquery" />
</head>
<body>
<div class="list">
<form action="__URL__/supplies_in_insert"  method="post" name="form1" onsubmit="return CheckForm();">
<table class="stripe" cellspacing="0">
    <thead>
        <tr>
		<th width="10%">编号</th>
		<th width="25%">物品名称</th>
		<th width="20%">规格</th>
		<th width="15%">单位</th>
		<th width="15%">库存</th>
		<th width="15%">数量</th>
	   </tr>
    </thead>
 
    <tbody>
	<volist name="data" id="vo">
    <tr>
		<td><input type="hidden" name="supplies_id[]" value="{$vo.id}" >{$vo.id}</td>
		<td>{$vo.supplies_name}</td>
		<td>{$vo.specification}</td>
		<td>{$vo.unit}</td>
		<td>
			<div class="sum1">
			<php>if($vo['sum']<$vo['min_number']){</php>
			<font color="red">{$vo.sum}</font>
			<php>}else{ echo $vo['sum'];}</php></div>
		</td>
		<td><input type='text' id="number{$i}" class="number" name="number[]" size="3" ><input type="hidden" id="sum" class="sum" value="{$vo.sum}" >{$vo.unit}</td>
	</tr>
	</volist>
	</tbody>
	<thead>
        <tr>
            <th colspan="8">
				<input type="hidden" name="tpl" value="1" >
				<input type="hidden" name="count" id="count" value="{$count}" >
				<input type="submit" value="提交" class="submit">&nbsp;&nbsp;
	       		<input type="button" value="返回" class="button" onClick="back();">
			</th>
        </tr>
    </thead>
</table>
</form>
</div>
</body>
</html>
<script language="javascript">
$(document).ready(function(){  
	$(".stripe tr").mouseover(function(){    
	  $(this).addClass("over");}).mouseout(function(){   
			$(this).removeClass("over");}) 
  	$(".stripe tr:even").addClass("alt");
	
	$('.number').blur(function(){
		var number = $(this).val();
		var sum = $(this).next('.sum').val();
		if(number == ""){
			alert('不能为空！');
		}else if (isNaN(number)) {
            alert('包含非数字');
            return false;
        } else if (number <= 0 ) {
            alert('需要大于数字');
            return false;
        }
	});
}); 
</script>  